/**
 * 路由相关类型定义
 */

import type { Router, RouteRecordRaw } from 'vue-router'

export interface BaseRouteMeta extends Record<string | number | symbol, unknown> {
    title: string
    icon: string
    /** 是否隐藏在菜单中 */
    hidden?: boolean
    /** 权限标识 */
    permission?: string
    /** 是否保持活跃状态 */
    keepAlive?: boolean
    /** 页面是否已加载过 */
    loaded?: boolean
    /** 激活路由 */
    activeRoute: string
    /** 权限等级 */
    permissionLevel: number
}

export interface BaseRoute {
    path: string
    name: string
    meta: BaseRouteMeta
    component?: (() => Promise<typeof import('*.vue')>) | string
    children: BaseRoute[]
}

export interface RouteGenerateOptions {
    router: Router
    accessRoutes: RouteRecordRaw[]
}
